﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

namespace ArgusLib.Math
{
	public struct Operator
	{
		public string OperatorString { get; private set; }
		public int NumberOfArguments { get; private set; }
		public int Priority { get; private set; }

		public Operator(string operatorString, int numberOfArguments, int priority)
			: this()
		{
			this.OperatorString = operatorString;
			this.NumberOfArguments = numberOfArguments;
			this.Priority = priority;
		}

		public static Operator Addition { get { return new Operator("+", 2, 100); } }
		public static Operator Subtraction { get { return new Operator("-", 2, 100); } }
		public static Operator Multiplication { get { return new Operator("*", 2, 110); } }
		public static Operator Division { get { return new Operator("/", 2, 110); } }
		public static Operator Power { get { return new Operator("^", 2, 120); } }
		public static Operator Factorial { get { return new Operator("!", 1, 120); } }

		public static Operator[] DefaultOperators
		{
			get
			{
				return new Operator[]
				{
					Operator.Addition,
					Operator.Subtraction,
					Operator.Multiplication,
					Operator.Division,
					Operator.Power,
					Operator.Factorial
				};
			}
		}
	}
}
